home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / inet_tcp / iauucp3 / inaddfe.wcc < prev    next >
Text File  |  1995-02-12  |  6KB  |  127 lines

  1. //=========================================================================//
  2. //       Security Front End for Internet Addresser 3.0 for Wildcat 4.01    //
  3. //                                                                         //
  4. //                                                                         //
  5. // Purpose: To restrict access to Internet Addresser via Sysop Configurable//
  6. //          Security Levels or a file called BADUSER.LST                   //
  7. //                                                                         //
  8. // To Compile: Place this .wcc in the same directory as IAUUCP3.WCX and run//
  9. //             this command from that directory:                           //
  10. //                  WCC INADDFE.WCC                                        //
  11. //                                                                         //
  12. // To Use: Start MAKEMENU and replace IAUUCP3.WCX with INADDFE.WCX in the   //
  13. //         command you use to start Internet Addresser with.               //
  14. //                                                                         //
  15. //         Edit the File INADDFE.INI and enter the names of the Security   //
  16. //         Profiles you would like to have access to Internet Addresser    //
  17. //                                                                         //
  18. //         Edit the file BADUSER.LST and enter the names of the users      //
  19. //         thatt you don't want to have access to INADD3                   //
  20. //                                                                         //
  21. //          Note: The Security names MUST be spelled correctly, one per    //
  22. //                line with no extra information in the file.              //
  23. //                The Security names are CASE SENSITIVE.                   //
  24. //                                                                         //
  25. //    No Error Trapping is coded in for the file operations. This is       //
  26. //    Something you may want to add.                                       //
  27. //                                                                         //
  28. //    Written by Kevin Erickson, Cyberdeck Systems Software, 1994          //
  29. //         YOU MAY FREELY DISTRIBUTE THIS SOURCE CODE AND PROGRAM          //
  30. //         MODIFY IT TO SUIT YOUR NEEDS - JUST LEAVE A LITTLE CREDIT       //
  31. //         IN HERE FOR US! <GRIN>                                          //
  32. //-------------------------------------------------------------------------//
  33.  
  34. Dim AccessSecurity as string *25        // Security levels to allow access
  35. Dim BadUser as string                   // Baduser's Variable (temp)
  36.  
  37. Dim Sec_ok as Integer                   // This variable is true if the user
  38.                                         // has access, false if not.
  39.  
  40. Dim Bad_User as Integer                 //This variable is true if the user's
  41.                                         //Name is found in the BADUSER.LST,
  42.                                         //false if not.
  43.  
  44. Declare Function CheckSecurity(USec as String, ASec as string) as Integer
  45.         //This function returns true if the user's security allows
  46.         //access. This function also sets the Sec_ok variable to true if
  47.         //the function returns true.
  48.  
  49. Declare Function CheckUser(UName as String, BName as string) As Integer
  50.         //This function returns true is the User's name was found in the
  51.         //BADUSER.LST. This function also sets the Bad_User variable to
  52.         //true if the function returns true.
  53.  
  54.  
  55. Sec_ok = False      //This makes an inital assumption of False
  56. Bad_User = False    //This also...
  57.  
  58.  
  59. Open (Progpath + "inaddfe.ini") for input as #1       //Opens the .INI file
  60.                                                       //To read in Security
  61.                                                       //levels.
  62.   While Not (EOF(1))
  63.     Input #1, AccessSecurity
  64.     If Checksecurity((User.SecLevel), (AccessSecurity)) then
  65.       Sec_ok = True    //If the Users Security matches one of the ones
  66.                        //defined in INADDFE.INI then Sec_ok is True.
  67.     End if
  68.   Wend
  69.  
  70. Close #1
  71.  
  72. If Sec_ok = False then goto NoWay            //If the Users Sec. Level was
  73.                                              //not found in the .INI file
  74.                                              //Deny Access.
  75.  
  76.  
  77. Open (Progpath + "baduser.lst") for input as #1     //Opens the BADUSER.LST
  78.                                                     //to check users name.
  79.    While Not (EOF(1))
  80.      Input #1, Baduser
  81.      If CheckUser((User.Name), (Baduser)) then
  82.        Bad_User = True         //If the User's name was found in the file then
  83.                                //Bad_User is True
  84.      End if
  85.    Wend
  86. Close #1
  87.  
  88. If Bad_User = True then goto Noway          //If the User's name was found in
  89.                                             //the BADUSER.LST then deny access
  90.  
  91.  
  92. Chain (progpath + "iauucp3.wcx")             //Start Internet Addresser 3.0 UUCP
  93. Goto Finish
  94.  
  95.  
  96. NoWay:                                      //This is what is told to the user
  97.                                             //when access is denied. Please
  98.                                             //leave my credit in there. :)
  99. Print
  100. Print "@0E@INADDFE - 1994 CyberDeck Systems Software@0F@"
  101. Print
  102. Print "Sorry you do not have the required access for this function. If you feel"
  103. Print "This is in error, please leave a comment to the Sysop. Thank you.@0E@"
  104. Print
  105. Waitenter
  106.  
  107.  
  108. Finish:                                   // End of Program
  109. End
  110.  
  111.  
  112.           // These are the Function Definitions:
  113.  
  114. Function CheckUser(UName as string, BName as String) As Integer
  115.   CheckUser = False
  116.   If Uname = Bname then
  117.     CheckUser = True
  118.   End if
  119. End Function
  120.  
  121. Function CheckSecurity(Usec as String, Asec as string) as Integer
  122.   CheckSecurity = False
  123.   If Usec = Asec then
  124.      CheckSecurity = True
  125.   End if
  126. End Function
  127.